package 剑指offer;

public class _10青蛙跳台阶 {
    public int numWays(int n) {
        if( n < 2 ){
            return 1;
        }
        int a = 1,b = 1;
        int res = 0;
        for(int i = 2; i <= n; i++){
            res = (a + b) % 1000000007;
            a = b;
            b = res;
        }
        return res;
    }
}
